package Timer;

public class demo1 {

    public static void main(String[] args) {
        MyTimer myTimer = new MyTimer();
        myTimer.schedule(() -> System.out.println(Thread.currentThread().getName() + "==> 正在执行，0s后执行"),0);
        myTimer.schedule(() -> System.out.println(Thread.currentThread().getName() + "==> 正在执行，4s后执行"),4000);
        myTimer.schedule(() -> System.out.println(Thread.currentThread().getName() + "==> 正在执行，5s后执行"),5000);
        myTimer.schedule(() -> System.out.println(Thread.currentThread().getName() + "==> 正在执行，6s后执行"),6000);
        myTimer.schedule(() -> System.out.println(Thread.currentThread().getName() + "==> 正在执行，7s后执行"),7000);
        myTimer.schedule(() -> System.out.println(Thread.currentThread().getName() + "==> 正在执行，8s后执行"),8000);


    }
}
